﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.burry.services.SizeService" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Bary</title>
<!--Script and CSS includes for YUI dependencies on this page-->
<link rel="stylesheet" type="text/css" href="Resource/yui/build/fonts/fonts-min.css" />
<link rel="stylesheet" type="text/css" href="Resource/yui/build/datatable/assets/skins/sam/datatable.css" />
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/main.css">
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/css.css">
<link rel="stylesheet" type="text/css" id="css" href="Resource/css/good.css">
<script type="text/javascript" src="Resource/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="Resource/yui/build/connection/connection-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/json/json-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/element/element-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/paginator/paginator.js"></script>
<script type="text/javascript" src="Resource/yui/build/datasource/datasource-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/datatable/datatable-min.js"></script>
<script type="text/javascript" src="Resource/yui/build/utilities/utilities.js"></script>
<script language="JavaScript" type="text/JavaScript" src="Resource/js/core.js"></script>
</head>

<%
	String goodId = request.getParameter("good_id");
	String colorId = request.getParameter("color_id");
%>

<script language="javascript" >

	
	function returnBack(){
		location.href = "manageSubColor.do?good_id=<%=goodId%>&color_id=<%=colorId%>";
	}
	</script>
<body id="yahoo-com" class=" yui-skin-sam">

  <div id="framed">
    <h2>库存管理</h2>
  </div>
  <div>
          <div class="line_pubForm">
            <table width="100%" style="tabSty">
            	<tr>
                <td width=120 align=right>商品简称：</td>
                <td align=left><input type="text" id="sname" name="sname" value="<%=goodId%>" class="iptSty" readonly="true">
                  &nbsp;&nbsp; 
              </tr>
              <tr>
                <td width=120 align=right>版色简称：</td>
                <td align=left><input type="text" name="cname" value="<%=colorId%>" class="iptSty" readonly="true" />
                  &nbsp;&nbsp; 
              </tr>
            </table>
            
          </div>
          <div class="line_pubForm">
            
<div id="demo">
    <div id="paging"></div>
    <div id="dt"></div>
    <br />
</div>

<script type="text/javascript">
var myDataTable = null;
YAHOO.util.Event.onDOMReady(function () {
    	
    	  var DataSource = YAHOO.util.DataSource,
        DataTable  = YAHOO.widget.DataTable,
        Paginator  = YAHOO.widget.Paginator;
        

       

        var myDataSource = new DataSource("getHolderInit.do?");
        myDataSource.responseType = DataSource.TYPE_JSON;
        myDataSource.responseSchema = {
        		resultsList :"returnObj",  
            fields: ["size","upper_num","qnum"],
            metaFields: {totalRecords: "totalRecords" }     
        };

		

		
		    var myTableConfig = {
		        initialRequest         : 'goodId=<%=goodId%>&colorId=<%=colorId%>'
		       
		    };
		    
		    var myColumnDefs = [
            {key:"size",label:"尺码"},
            {key:"upper_num",label:"上架数量"},
            {key:"qnum",label:"库存数量"}
        ];

        myDataTable = new DataTable("dt", myColumnDefs, myDataSource, myTableConfig);
				myDataTable.subscribe("rowMouseoverEvent", myDataTable.onEventHighlightRow);   
	      myDataTable.subscribe("rowMouseoutEvent", myDataTable.onEventUnhighlightRow);   
	      myDataTable.subscribe("rowClickEvent", myDataTable.onEventSelectRow);   
            

       
});

function update(){
					var rows =  myDataTable.getSelectedRows();
					var record = myDataTable.getRecord(rows[0]);
					location.href = "updateHold.do?good_id=<%=goodId%>&color_id=<%=colorId%>&size=" + record.getData("size") + "&upper="+record.getData("upper_num") + "&qty="+record.getData("qnum");
}


</script>

            
         
            
          </div>
          
          <div class="line_pubForm">
            
            
         <input type="button" value="修改" onclick="update()" /> &nbsp; <input type="button" value="返回" onclick="returnBack()" />
            
          </div>


  </div>
</body>
</html>
